package com.zjr.system.controller.user;

import com.zjr.common.core.controller.BaseController;
import com.zjr.common.core.domain.R;
import com.zjr.common.core.domain.TableDataInfo;
import com.zjr.system.domain.user.dto.UserDTO;
import com.zjr.system.domain.user.dto.UserQueryDTO;
import com.zjr.system.service.user.IUserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

@RestController
@RequestMapping("/user")
public class UserController extends BaseController {

    @Autowired
    IUserService iUserService;

    // 查询相应的用户数据 - 页数/页码/昵称/id
    @GetMapping("/list")
    public TableDataInfo list(UserQueryDTO userQueryDTO){
        return getTableDataInfo(iUserService.list(userQueryDTO));
    }

    // 更新用户状态信息（拉黑/解封）
    @PutMapping("/updateStatus")
    public R<Void> updateStatus(@RequestBody UserDTO userDTO){
        return toR(iUserService.updateStatus(userDTO));
    }
}
